#ifndef SHADER_H
#define SHADER_H

#include "Config/Export.h"
#include "Core/ShaderBase.h"
#include "Maths/TVector2.h"
#include "Maths/TVector3.h"
#include "Maths/Matrix4f.h"
#include "Utilities/TColor4.h"
#include "GL/glew.h"

namespace blue {

class SHARED Shader
{
    public:

        Shader(ShaderBase *vtshader = NULL, ShaderBase *pcshader = NULL);
        Shader(const char *vtname, const char *pcname);
        ~Shader();

        void load(const char *vtname, const char *pcname);

        void setShader(bool set);

        bool isShader();
        GLuint getProgram() const;

        ShaderBase *getVertexShader() const;
        ShaderBase *getPixelShader() const;

        void SetParameter(const char *name, int value);
        void SetParameter(const char *name, float value);
        void SetParameter(const char *name, const Vector2f& value);
        void SetParameter(const char *name, const Vector3f& value);
        void SetParameter(const char *name, const Color4f& value);


    private:

        void create();

        GLuint _program;
        ShaderBase *_vtshader, *_pcshader;
        bool _created;

};

}

#endif
